import request from 'umi-request';

export async function querySettlementList(params = {}) {
  return request('/api/member/api-member/dimissionPC/queryDimissionSettlementList', {
    method: 'get',
    params: {
      pageNum: params.current,
      pageSize: params.pageSize,
    },
  }).then((res) => {
    if (res.flag) {
      const data = res.data;
      return {
        current: data.currPage,
        data: data.list,
        pageSize: data.pageSize,
        success: true,
        total: data.totalCount,
      };
    } else {
      return {};
    }
  });
}

export async function updateDimissionSettlement(params) {
  return request('/api/member/api-member/dimissionPC/updateDimissionSettlement', {
    method: 'POST',
    data: {
      ...params,
    },
  }).then((res) => {
    return res;
  });
}

export async function sendSettlementBpm(id) {
  return request(`/api/member/api-member/bpmMember/dimissionSettlementBpm`, {
    method: 'get',
    params: {
      id:id
    }
  }).then((res) =>{
    return res;
  });
}
